<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ include file="/parameter.jsp"%>
<%@page isELIgnored="false"%>
<!DOCTYPE>
<html>
<head>
<TITLE>论坛</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<Meta http-equiv="Pragma" Content="No-cach">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
<link href="style/style.css" rel="stylesheet" type="text/css" />
<script language="javascript">
	function loginsubmit() {
		return document.forms["form1"].submit();
	}
function SearchSubmit(){
	if(doucment.getElementById('keywords').value == ""){
		alert("请输入搜索关键字！");
		return false;
	}else{
		return document.forms["form3"].submit();
	}
}
</script>
</HEAD>
<body>
	<jsp:include page="inc/header.jsp" />
	<header class="entry-header">
		<h1 class="entry-title">
			<span>论坛首页
				<div id="searchbar">
					<form name="form3" method="post"
						action="commonAction.do?method=SearchTopic">
						<input type="text" id="keywords" name="keywords" title="搜索"><button onClick="search();">搜索</button>
					</form>
				</div>
			</span>
		</h1>
	</header>

	<div id="maindiv">
		<div id="nav">
			<c:choose>
				<c:when test="${sessionScope.user == null}">
					<div>
						<form name="form1" method="post"
							action="commonAction.do?method=UserLogin">
							账号：<input type="text" name="username"> 密码：<input
								type="password" name="password">
							<button onClick="loginsubmit();">登陆</button>
							<a href="commonAction.do?method=toRegister">注册新账号</a>
						</form>
					</div>
				</c:when>
				<c:otherwise>
					<div>
						&nbsp;&nbsp;<c:choose><c:when test="${sessionScope.user.nickname != ''}">${sessionScope.user.nickname}</c:when><c:otherwise>${sessionScope.user.username}</c:otherwise></c:choose>&nbsp;你好！<a
							href="commonAction.do?method=Logout">注销</a>&nbsp;|&nbsp;<a
							href="commonAction.do?method=EditUserInfo&uid=${sessionScope.user.id}">修改个人信息</a>&nbsp;|&nbsp;<a
							href="commonAction.do?method=EditUserPwd&uid=${sessionScope.user.id}">修改密码</a>
					</div>
				</c:otherwise>
			</c:choose>
			<a href="./" title="首页">首页</a> <span>&gt;</span> <a href="###">用户资料修改</a>
		</div>
		<div id="board">
			<div class="bm">
				<div id="post_r">
					<div class="bm_h">
						<h2>用户资料修改</h2>
					</div>
					<div class="replay_b">
						<form name="userInfoForm" method="post"
							action="commonAction.do?method=EditUserInfoSubmit"
							enctype="multipart/form-data">
							<input type="hidden" name="uid" value="${UserInfo.id}" />
							<div class="msg">
								<!--<span class="message cl">&#8226;&nbsp;提示消息样式</span> -->
                                <span class="error cl"><div id="info"></div><span>
							</div>
							<div class="frm_row">
								<label>用户名: </label>${UserInfo.username}
							</div>
							<div class="frm_row">
								<label>邮件地址: </label><input type="text" name="email" size="30"
									maxlength="50" value="${UserInfo.email}" title="请填写邮件地址！">
								*经常使用的邮箱地址
							</div>
							<div class="frm_row">
								<label>昵称: </label><input type="text" name="nickname" size="20"
									maxlength="20" value="${UserInfo.nickname}" title="请填写昵称！">
							</div>
							<div class="frm_row">
								<label>性别: </label><select name="sex" onChange="">
									<option value="保密"
										<c:if test="${UserInfo.sex == '保密'}">selected</c:if>>保密</option>
									<option value="帅哥"
										<c:if test="${UserInfo.sex == '帅哥'}">selected</c:if>>帅哥</option>
									<option value="美女"
										<c:if test="${UserInfo.sex == '美女'}">selected</c:if>>美女</option>
								</select>
							</div>
							<div class="frm_row">
								<label>自定义头像: </label><input type="file" name="portrait"
									size="50" alt="用户上传头像！">
								*用户可以上传自己喜爱的图片作为头像。用户上传文件后不能再更改！
							</div>
							<div class="frm_row">
								<label> </label><img style="border:1px solid gray;"
									src="${UserInfo.portraitpath}${UserInfo.portrait}"
									width="120px" height="120px" align="absMiddle">
							</div>

							<div class="frm_row">
								<button onClick="this.form.submit();">  保 存  </button>
							</div>
						</form>
					</div>

				</div>
			</div>
		</div>
	</div>


	<jsp:include page="inc/footer.jsp" />
</body>
</HTML>